<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:ctg="http://www.crotouristguide.com/taglib"
	xmlns:rich="http://richfaces.org/rich">

<ui:component>
	<rich:panel id="currency">
		<f:facet name="header">
			<h:outputText value="#{messages['label.exchange.rate']}" />
		</f:facet>

	
	
	<div class="home_infobox">
      <div class="home_infobox_text">
      <ui:repeat value="#{currencies}" var="currency">
        <s:div style="display: none;">
			<s:div styleClass="left flag #{currency.valuta.oznaka}" ></s:div>
			<s:div style="width:20%" styleClass="left">#{currency.valuta.oznaka}</s:div>
			<s:div style="width:20%" styleClass="left">#{currency.valuta.jedinica}</s:div>
			<s:div styleClass="left">#{currency.srednji}</s:div>
			<br class="clearb" />
        </s:div>
      </ui:repeat>  
      </div>
      <div class="home_infobox_control">
        <a class="prev" href="#">&lt;</a>
        <a class="next" href="#">&gt;</a>
      </div>
      <br class="clearb" />
    </div>
    <br class="clearb" />	
    <script type="text/javascript">
      //<![CDATA[
        jQuery(function(){
          //Infobox
          jQuery('div.home_infobox').each(function(){
            var $box = jQuery(this)
            var $posts = jQuery('.home_infobox_text > div',$box).hide();
            if($posts.length==0)return;//no posts...
            jQuery($posts[0]).show();
            var current = 0;
        
            var show_hide = function(add){
          	jQuery($posts[current]).hide();
              current = (current+$posts.length+add) % $posts.length;
              jQuery($posts[current]).show();
              return false;
            }
        
            jQuery('a.next',$box).click(function(){ return show_hide(1); });
            jQuery('a.prev',$box).click(function(){ return show_hide(-1); });
          })
        });
      //]]>
    </script>	
    
    </rich:panel>
</ui:component>
</html>